{% extends "sklad/base-tree.html" %}
{% block content %}
<h3>
<A href="{% url index %}">Начало</A>
	{% for cp in category_path %}
     / <A href="{% url category_view cp.id %}">{{ cp.name }}</A>{#{% if not forloop.last %} / {% endif %}#}
	{% endfor %} 
</h3>
<p class="item_menu"><a href="{% url part_create %}">Добавить</a></p>

{% if sub_categories %}
<h4>Подкатегории:</h4>
{% for item in sub_categories %}
<p>  

<a href="{% url category_view item.id %}">{{ item.name }}</a>

</p>



{% endfor %}
{% endif %}


{% if partlist %}
<h4>Комплектующие:</h4>
<table class="table_list">
<tr>
<th>Наименование</th>
<th>Код</th>
<th>Кол-во</th>
<th>Единицы</th>
<th>Место</th>
<th>Дата</th>
<th> </th>
<th> </th>
</tr>
{% for item in partlist %}
<tr class="{% cycle 'even' 'odd' %}">
<td>
<a href="{% url part_property item.part.id %}">
{{ item.part.name }}
</a>
</td>
<td>{{ item.code }}</td>
<td>{{ item.count__sum }}</td>
<td>{{ item.unit.name }}</td>
<td>{{ item.place }}</td>
<td>{{ item.data|date:"d M Y"  }}</td>
<td><a href="{% url part_edit item.id %}"><img src="{% load media %}{% media_prefix %}img/icon_changelink.gif" width="10" height="10" title="Изменить {{ item.name }}"></a></td>
<td><a href="{% url part_delete item.id %}"><img src="{% media_prefix %}img/icon_deletelink.gif" width="10" height="10" title="Удалить {{ item.name }}"></a></td>
</tr>
{% endfor %}
</table>
{% endif %}



{% endblock %}
